package request

import (
	"gitee.com/g-qs/gin-vue-admin/server/model/common/request"
	"gitee.com/g-qs/gin-vue-admin/server/model/health"
	"gitee.com/g-qs/gin-vue-admin/server/model/hierarchy"
)

type PhysiqueSearch struct {
	health.Physique
	request.PageInfo
}

type PhysiqueArticle struct {
	PhysiqueID       uint                        `json:"physique_id" gorm:"column:physique_id;"`
	ArticleID        uint                        `json:"article_id" gorm:"column:article_id;"`
	Type             string                      `json:"type" gorm:"column:type;"`
	Physique         *health.Physique            `json:"-" form:"-" gorm:"->;foreignKey:PhysiqueID;references:ID;"` // 关联体质
	FdArticleAudio   *hierarchy.FdArticleAudio   `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"`  // 关联音频文章
	FdArticleVideo   *hierarchy.FdArticleVideo   `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"`  // 关联视频文章
	FdArticleGraphic *hierarchy.FdArticleGraphic `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"`  // 关联图文文章
}

type PhysiqueGraphicReq struct {
	PhysiqueID uint   `json:"physique_id" gorm:"column:physique_id;"`
	Graphics   []uint `json:"graphic_id" gorm:"column:graphic_id;"`
	Audios     []uint `json:"audio_id" gorm:"column:audio_id;"`
	Videos     []uint `json:"video_id" gorm:"column:video_id;"`
}

func (PhysiqueArticle) TableName() string {
	return "fd_physique_article"
}
